package com.dcm.live.mapper;

import com.dcm.live.entity.UserLikeEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * [点赞]
 *
 * @author : [pengrongsheng]
 * @createTime : [2021/4/8]
 */
public interface LikedMapper {

    /**
     * 保存点赞记录
     *
     * @param userLikeEntity
     * @return
     */
    void insert(UserLikeEntity userLikeEntity);
    /**
     * 修改点赞记录
     *
     * @param userLikeEntity
     * @return
     */
    void update(UserLikeEntity userLikeEntity);

    /**
     * 即查询都谁给这个人点赞过
     *
     * @param likedUserId 被点赞人的id
     * @return
     */
    List<UserLikeEntity> getLikedListByLikedUserId(Long likedUserId);

    /**
     * 即查询这个人都给谁点赞过
     *
     * @param likedPostId 用户
     * @return
     */
    List<UserLikeEntity> getLikedListByLikedPostId(Long likedPostId);

    /**
     * 根据 id 查找数据
     * @param likedUserId
     * @param likedPostId
     * @return
     */
    UserLikeEntity findByUidAndId(@Param("likedUserId") Long likedUserId, @Param("likedPostId") Long likedPostId);


}
